#ifndef KTITLEWINDOW_H
#define KTITLEWINDOW_H

#include <QWidget>
#include <QPushButton>
#include "kpushbutton.h"
#include "../screencapsdk_global.h"

namespace kdk
{

/**
 * @defgroup FormModule
 * @since 2.5
 */

class KTitleWindowPrivate;

class SCREENCAPSDK_EXPORT KTitleWindow : public QWidget
{
   Q_OBJECT

public:
    KTitleWindow(QWidget *parent = nullptr);

    /**
     * @brief 获取添加按钮
     * @return
     */
    KPushButton *addButton();

    /**
     * @brief 获取颜色按钮
     * @return
     */
    QPushButton *colorButton();

    /**
     * @brief 获取menu按钮
     * @return
     */
    QPushButton *menuButton();

    /**
     * @brief 获取widget
     * @return
     */
    QWidget *baseWidget();

    /**
     * @brief 设置标题颜色
     * @param color
     */
    void setTitleColor(QColor color);

protected:
    void resizeEvent(QResizeEvent *event);
    void paintEvent(QPaintEvent *event);
    bool eventFilter(QObject *watched, QEvent *event);

private:
    Q_DECLARE_PRIVATE(KTitleWindow)
    KTitleWindowPrivate *const d_ptr;
};

}

#endif // KTITLEWINDOW_H
